#include "SnatchEnemyItem.h"
#include "../../model/proxy/ChanllengeProxy.h"
#include "../../model/static/StaticItem.h"
#include "../../utils/LocalString.h"

SnatchEnemyItem::SnatchEnemyItem(void)
	:mDesc(NULL)
{
}

SnatchEnemyItem::~SnatchEnemyItem(void)
{
	CC_SAFE_RELEASE(mDesc);
}

bool SnatchEnemyItem::init()
{
	return true;
}

SEL_MenuHandler SnatchEnemyItem::onResolveCCBCCMenuItemSelector(CCObject * pTarget, CCString * pSelectorName )
{
    ChallengeItem::onResolveCCBCCMenuItemSelector(pTarget, pSelectorName);
	return NULL;
}

SEL_CCControlHandler SnatchEnemyItem::onResolveCCBCCControlSelector( CCObject * pTarget, CCString * pSelectorName )
{
    ChallengeItem::onResolveCCBCCControlSelector(pTarget, pSelectorName);
	return NULL;
}

bool SnatchEnemyItem::onAssignCCBMemberVariable( CCObject * pTarget, CCString * pMemberVariableName, CCNode * pNode )
{
    ChallengeItem::onAssignCCBMemberVariable(pTarget, pMemberVariableName, pNode);
	CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mDesc", CCLabelTTF *, this->mDesc);
	return false;
}

void SnatchEnemyItem::onNodeLoaded( CCNode * pNode, CCNodeLoader * pNodeLoader )
{

}

void SnatchEnemyItem::onEnter()
{
	CCNode::onEnter();
}

void SnatchEnemyItem::onExit()
{
	CCNode::onExit();
}

void SnatchEnemyItem::refresh()
{
	ChallengeItem::refresh();
	ChallengeEnemyInfo* challengeEnemyInfo = (ChallengeEnemyInfo*)mData;
	mDesc->setString(fls("challenge_info",
		challengeEnemyInfo->time,
		challengeEnemyInfo->name.c_str(),
		challengeEnemyInfo->gold));
}

void SnatchEnemyItem::_onNotification( CCObject* object )
{
	
}
